package com.hx.controller;


import com.alibaba.dubbo.config.annotation.Reference;
import com.hx.pojo.User;
import com.hx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user")
public class UserController {

    //@Reference(loadbalance = "roundrobin")
    @Autowired
    private UserService userService;

    @RequestMapping("/findUserById")
    public User findUserById(Integer id){
        System.out.println("...");
        User user = userService.findUserById(id);
        System.out.println("User--->"+user);
        return user;
    }
}
